/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.farmcode.console.api.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author Oscar Ivan Prado
 */
@Entity
@Table(name = "FC_USER_BY_PROJECT")
public class UserByProject implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "USER_BY_PROJECT_ID")
    private Long userByProjectId;
    @Column(name = "PROJECT_ID")
    private Long projectId;
    @Column(name = "USER_NAME")
    private String userName;
    

    public UserByProject() {
    }

    public UserByProject(Long userByProjectId) {
        this.userByProjectId = userByProjectId;
    }

    public Long getUserByProjectId() {
        return userByProjectId;
    }

    public void setUserByProjectId(Long userByProjectId) {
        this.userByProjectId = userByProjectId;
    }

    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (userByProjectId != null ? userByProjectId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof UserByProject)) {
            return false;
        }
        UserByProject other = (UserByProject) object;
        if ((this.userByProjectId == null && other.userByProjectId != null) || (this.userByProjectId != null && !this.userByProjectId.equals(other.userByProjectId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.UserByProject[ userByProjectId=" + userByProjectId + " ]";
    }
    
}
